package descentFly.app.tools
{
	import UIFree.ObjectEvent;
	import UIFree.uif_component;
	
	import descentFly.app.df_component;
	import descentFly.app.df_label;
	import descentFly.df_space;
	
	import flash.geom.Rectangle;
	
	public class df_levelInfo extends df_toolBlock {
		private var _label		: df_label;
		public function df_levelInfo(parent:uif_component, aheight:int=0) {
			super(parent, 300, aheight);
		}
		
		override protected function createComponents(layer: df_component, inner: Rectangle):void {
			_label 	= new df_label(layer, inner.x, inner.y, inner.width, df_label.DEFAULTHEIGHT, 'toolLabelLeft');
		}
		
		override protected function listenEvents():void {
			super.listenEvents();
			Space.addEventListener(df_space.CHANGELEVEL, doChangeLevel);
		}
		
		private function doChangeLevel(event: ObjectEvent): void {
			_label.text = event.object.name;
		}
	}
}